<!--<template>-->
<!--  <div>-->
<!--    <el-button @click="printMore" type="success">打印</el-button>-->
<!--    <el-button @click="printOnly" type="success">打印</el-button>-->
<!--    <print-more ref="PrintMore"/>-->
<!--    <print-only ref="PrintOnly"/>-->
<!--    <export-order/>-->
<!--    <export-special/>-->
<!--  </div>-->
<!--</template>-->

<!--<script>-->
<!--  import PrintMore from '@/views/print/print_more';-->
<!--  import PrintOnly from '@/views/print/print_only';-->
<!--  import ExportOrder from '@/views/export/ExportOrder';-->
<!--  import ExportSpecial from '@/views/export/ExportSpecial';-->

<!--  export default {-->
<!--    name: 'Home',-->
<!--    components: {PrintMore, PrintOnly, ExportOrder, ExportSpecial},-->
<!--    methods: {-->
<!--      printMore() { // 批量打印-->
<!--        let _this = this.$refs.PrintMore;-->
<!--        _this.visible = true;-->
<!--        _this.numberList = ['0000000000007'];-->
<!--        _this.getPrint();-->
<!--      },-->
<!--      printOnly() {-->
<!--        let _this = this.$refs.PrintOnly;-->
<!--        _this.visible = true;-->
<!--        _this.orderNumber = '0000000000007';-->
<!--        _this.getPrint();-->
<!--        // _this.getChildNumberWarning();-->
<!--      }-->
<!--    }-->
<!--  }-->
<!--</script>-->

<template>
  <div id="home" :style="'height:' + (mainHeight - 30) + 'px'" v-show="isShow"></div>
</template>

<script>
  const {title} = require("@/settings");
  const elementResizeDetectorMaker = require("element-resize-detector");
  let mainResizeListen = elementResizeDetectorMaker();

  export default {
    name: "Home",
    data() {
      return {
        mainHeight: 0,
        isShow: false
      };
    },
    computed: {
      title() {
        return title
      }
    },
    mounted() {
      this.addListen();
    },
    methods: {
      addListen() {
        let main = document.querySelector(".el-main");
        this.mainHeight = main.offsetHeight;
        this.isShow = true;
        mainResizeListen.listenTo(main, () => {
          this.$nextTick(() => {
            this.mainHeight = main.offsetHeight;
          });
        });
      }
    },
    beforeDestroy() {
      let main = document.querySelector(".el-main");
      mainResizeListen.uninstall(main);
    }
  };
</script>

<style lang="scss">
  #home {
    -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    background: url("../../assets/home.jpg") no-repeat center center;
    background-size: cover;
  }
</style>
